package it.com.cci.strategy_pattern;

/**
 * @author Lefnmg
 * @Description:
 * @date 2018/3/24
 */
public class DuckTest {
    public static void main(String[] args) {
//        Duck duck = new MallardDuck();
//        duck.performFly();
//        duck.performQuack();
        Duck duck = new ModelDuck();
        duck.performFly();
        duck.setFlyBehavior(new FlyRocketPowered()); //运行时改变鸭子的行为
        duck.performFly();
    }
}
